package com.datasecops.scannerservices.enumerate;

 /**
  * 数据库驱动
  * @Description
  * @author SunLingzhi
  * @time 2022/8/15 9:50
  * @param
  * @return
  */
public enum DBDrive {

     MYSQL("0","com.mysql.jdbc.Driver"),

     ORACLE("1","oracle.jdbc.driver.OracleDriver"),

     SQLSERVER("2","com.microsoft.sqlserver.jdbc.SQLServerDriver"),

     HIVE("3","org.apache.hive.jdbc.HiveDriver"),

     POSTGRESQL("4","org.postgresql.Driver"),

     MONGODB("5","org.mongodb.Driver"),

     DM("6","dm.jdbc.driver.DmDriver"),

     DB2("7","com.ibm.db2.jdbc.app.DB2Driver"),

     OSCAR("8","com.oscar.Driver");

     private String key;
     public String getKey() {
         return key;
     }

     private String value;
     public String getValue() {
         return value;
     }

     DBDrive(String key,String value) {
         this.key = key;
         this.value = value;
     }

     public static String getValue(String key) {
         for (DBDrive ele : values()) {
             if (ele.getKey().equals(key)) {
                 return ele.getValue();
             }
         }
         return null;
     }

     public static void main(String[] args) {
         System.out.println(DBDrive.getValue(DBType.MYSQL.getKey()));
     }
}
